﻿using PMS.Core.Configuration;
using System.Collections.Generic;

namespace PMS.Data.Entities.Settings
{
    /// <summary>
    /// Common settings
    /// </summary>
    public class CommonSettings : ISettings
    {
        public CommonSettings()
        {
            IgnoreLogWordlist = new List<string>();
        }

        /// <summary>
        /// Gets or sets a value indicating whether 404 errors (page or file not found) should be logged
        /// </summary>
        public bool Log404Errors { get; set; }

        /// <summary>
        /// Gets or sets a breadcrumb delimiter used on the site
        /// </summary>
        public string BreadcrumbDelimiter { get; set; }

        /// <summary>
        /// Gets or sets ignore words (phrases) to be ignored when logging errors/messages
        /// 屏蔽日志信息中某些关键字词(既不记录日志)
        /// </summary>
        public List<string> IgnoreLogWordlist { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether to compress response (gzip by default). 
        /// You may want to disable it, for example, If you have an active IIS Dynamic Compression Module configured at the server level
        /// https://www.cnblogs.com/savorboard/p/aspnetcore-response-compression-caching.html
        /// Microsoft.AspNetCore.ResponseCompression 这个中间件是 .NET Core 1.1 版本中新增加的，它主要是负责对输出的内容进行压缩，WEB开发中主要就是 GZip 压缩。
        /// Gzip 压缩是我们在 WEB 中经常会使用的一项性能优化技术，它可以对页面输出的内容使用压缩算法（GZip）进行体积的压缩， 
        /// 那在以前的时候，我们可以使用 IIS 来做这项工作，如果使用非IIS托管(如Linux+Nginx)，就可以选择此中间件来帮我们做这件事情了。
        /// </summary>
        public bool UseResponseCompression { get; set; }

        /// <summary>
        /// Gets or sets a value of "Cache-Control" header value for static content (in seconds)
        /// </summary>
        public string StaticFilesCacheControl { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether to enable markup minification
        /// </summary>
        public bool EnableHtmlMinification { get; set; }

        /// <summary>
        /// A value indicating whether JS file bundling and minification is enabled
        /// </summary>
        public bool EnableJsBundling { get; set; }

        /// <summary>
        /// A value indicating whether CSS file bundling and minification is enabled
        /// </summary>
        public bool EnableCssBundling { get; set; }

        /// <summary>
        /// The length of time, in milliseconds, before the running schedule task times out. Set null to use default value
        /// </summary>
        public int? ScheduleTaskRunTimeout { get; set; }

        /// <summary>
        /// Gets or sets a value TimeZoneId
        /// 系统保存时间统一为UtcTime,为转换为本地时间，需要获取默认时区/或根据语言选择对应时区进行时间转化
        /// </summary>
        public string DefaultStoreTimeZoneId { get; set; }

        /// <summary>
        /// Whether to DisplayMiniProfiler
        /// </summary>
        public bool DisplayMiniProfiler { get; set; }

    }
}
